package com.xiqi.microservice.auth.config;
import org.springframework.beans.factory.annotation.Value;

/**
 * @program: authcommons
 * @description: JWT的配置类
 * @author: Shine
 * @create: 2019-08-01 11:43
 */

public class JWTAuthenticationConfig {

    @Value("${com.xiqi.microservice.url:/login}")
    private String url;
    //设置JWT数据所在的请求头
    @Value("${com.xiqi.microservice.header:Authentication}")
    private String header;
    //JWT前置标记
    @Value("${com.xiqi.microservice.prefix:Bearer}")
    private String prefix;
    //token有效期
    @Value("${com.xiqi.microservice.expriation:#{60*60*24}}")
    private int expriation;

    @Value("${com.xiqi.microservice.secret}")
    private String secret;

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getHeader() {
        return header;
    }

    public void setHeader(String header) {
        this.header = header;
    }

    public String getPrefix() {
        return prefix;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    public int getExpriation() {
        return expriation;
    }

    public void setExpriation(int expriation) {
        this.expriation = expriation;
    }

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    @Override
    public String toString() {
        return "JWTAuthenticationConfig{" +
                "url='" + url + '\'' +
                ", header='" + header + '\'' +
                ", prefix='" + prefix + '\'' +
                ", expriation=" + expriation +
                ", secret='" + secret + '\'' +
                '}';
    }
}
